/*
 * location_access.c
 *
 *  Created on: 2012/05/31
 *      Author: guanxiaoying
 */
#include "../coredef.h"
TYPE_CODE_SCOPE DLL_EXPORT CCodeScope;
EXTERNAL_SYMBOL( CCodeScope );

static U4 getFilePath( AST index, PSZ buffer, U4 len ){
	return stCoreFileIndexAccess.getFile( stCoreCodeScpAccess.fileindex.get( index ),
			buffer, len );
}
static PSZ getLastSegmentName( AST index, U4 len ){
	return stCoreFileIndexAccess.getLastSegmentName( stCoreCodeScpAccess.fileindex.get( index) , len );
}
VOID CCodeScopeInit( VOID ){
	CCodeScope.getMax = stCoreCodeScpAccess.getMax;
	CCodeScope.getFilePath = getFilePath;
	CCodeScope.getLastSegmentName = getLastSegmentName;
	/*debug,12/10/16,S*/
	CCodeScope.getFileIndex = stCoreCodeScpAccess.fileindex.get;
	/*debug,12/10/16,E*/
	CCodeScope.getBeginLine = stCoreCodeScpAccess.startLine.get;
	CCodeScope.getEndLine = stCoreCodeScpAccess.endLine.get;
	CCodeScope.getBeginLineOffset = stCoreCodeScpAccess.startOffset.get;
	CCodeScope.getEndLineOffset = stCoreCodeScpAccess.endOffset.get;
}

/*debug,12/10/16,S*/
TYPE_FILE_INDEX DLL_EXPORT CFileIndex;
EXTERNAL_SYMBOL( CFileIndex );
VOID CFileIndexInit(VOID){
	CFileIndex.getMax = stCoreFileIndexAccess.getMax;
	CFileIndex.getFilePath = stCoreFileIndexAccess.getFile;
	CFileIndex.getModifyTime = stCoreFileIndexAccess.getModifyTime;
	CFileIndex.getSize = stCoreFileIndexAccess.getSize;
	CFileIndex.isFolder = stCoreFileIndexAccess.isFolder;
	CFileIndex.isExisted = stCoreFileIndexAccess.isExisted;
	CFileIndex.getTransUnit = stCoreFileIndexAccess.transUnit.get;
}
/*debug,12/10/16,E*/
